﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace CARE
{
	public partial class SwitcherControl : UserControl
	{
		public SwitcherControl() : base() {
			InitializeComponent();
			SizeChanged += new SizeChangedEventHandler(SwitcherControl_SizeChanged);
		}
		
		public void SwitchPage(UserControl oPage) {
			//oPage.Background = new SolidColorBrush(Colors.Transparent);
			oPage.Margin = new Thickness(5, 5, 5, 5);
			oPage.Width = this.Width - 10;
			oPage.Height = this.Height - 10;

			Content = oPage;
		}

		void SwitcherControl_SizeChanged(object sender, SizeChangedEventArgs e) {
			if (Content != null) {
				((UserControl)Content).Width = this.Width - 10;
				((UserControl)Content).Height = this.Height - 10;
			}
		}
	}
}